#ifndef _PIANO_PROGRAM_MAIN_WINDOW_H_
#define _PIANO_PROGRAM_MAIN_WINDOW_H_

#include <ne.h>

namespace pp
{
    class MainWindow : public ne::Singleton<MainWindow>, public ne::Screen::Listener
    {
        public:
            MainWindow();

            bool tick();

            bool render();

            void setBackgroundColor(const ne::Color &color)
            {
                mBackgroudColor = color;
            }

            const ne::Color& getBackgroundColor() const
            {
                return mBackgroudColor;
            }

            ne::Viewport* getViewport() const
            {
                return mpViewport;
            }

            virtual void onResolutionChange(const uint32_t width, const uint32_t height);
            virtual void onFullScreenChange(const bool b);

            virtual ~MainWindow();

        public:
            static MainWindow& GetSingleton();

            static MainWindow* GetSingletonPtr();

        private:
            ne::Engine *mpEngine;
            ne::Screen *mpScreen;
            ne::RenderSystem *mpRenderSystem;
            ne::Color mBackgroudColor;
            ne::Camera *mpCamera;
            ne::Viewport *mpViewport;
            ne::Timer *mpTimer;
            int mFrameNum;
            double mFrameTime;
            double mFPS;
    };
}

#endif
